Repository navigation
feat(plugins): allow backends to run tests in the native Tests panel - #234
Merged
Merged
Conversation
2 tasks done
WhiteZeek
marked this pull request as ready for review
December 1, 2026 03:31
xiaoyumuxi
reviewed
Dec 1, 2026
xiaoyumuxi
left a comment
Contributor
There was a problem hiding this comment.
整体设计没问题,权限、请求格式和报告校验都在 Core。下面几处建议合入前处理:
- 旧宿主兼容说明与实际不符。 契约
shared/plugins/contract/v1/README.md写的是 “A host without the methods refuses them as unavailable”,PR 描述也说 “An older host does not grant the new methods”。但旧 Core 的rust/crates/plugin-manifest/src/permissions.rs遇到不认识的权限会以plugin.permission.unknown拒绝整个清单,所以声明了tests.start的插件在旧桌面端上根本装不上,不只是方法不可用。建议:- 契约里写明旧宿主会拒绝安装;
protocol-changelog.md这一行标为“0 内的补充”,写上旧宿主行为和首个支持的 Core revision(参照 #239 那行);- 同一行补上新权限
tests.start、新 Core 命令build.decodeInlineTestResults和新日志事件run.tests.state_changed。
- 只传
target、不传project时两边不一致。 Core 的参数检查放行,桌面端因为target.ProjectID != ""返回plugin.host.preconditionFailed。建议 Core 直接按invalidParams拒绝,或在契约里写明 target 必须和 project 一起传。 - 小问题:
shared/plugins/sdk/node/src/index.d.ts里/** Permission window.messages … */这行注释现在落在新加的readonly tests上面,tests应挪到这行注释之前;- Go SDK 导出的
Tests.Start、Tests.Results缺文档注释。
已核对:tests/results 的 offset ≤ 10000 和 MAX_TEST_CASES = 10_000 一致,没问题。
# Conflicts: # shared/plugins/reference/protocol-changelog.md
# Conflicts: # shared/plugins/reference/protocol-changelog.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue 1lck/Lithe-IDEA#2499.
Changes
tests.startand a host that advertises the service. Keep manifest, plugin function and canonical report versions unchanged. Rust, Go, Node and Java expose scoped calls.testsarray. An empty array is valid. Core then applies the existing provider validation and outcome aggregation. Schema, fixture and contract describe ownership, limits, failure codes and callback-scoped pagination.lithe/host/tests/startlithe/host/tests/resultsUse
lithe/host/getCapabilitiesfor discovery. A Core version that predatestests.startrejects a manifest declaring it at installation withplugin.permission.unknown. Hosts that recognize the permission advertise the methods they support. A buildtargetrequires itsprojectand returnsplugin.host.invalidParamswhen the project is omitted. Unknown fields, invalid parameters, stale contexts, missing instances and busy workspaces use existing documented errors. The four SDKs reuse their standard function handlers, cancellation and error propagation.Review by layer
Verification
At
45bd06c, the protocol changelog retains the entries for #234, #245 and #246. Both stack layers have the same file-level edits as before the sync. The contract documentation check, its two tests and the Node SDK type check passed. The Node SDK suite passed 91 tests and skipped four.At
950e196, Windows x64 passed the affectedlithe-plugin-rpc,lithe-buildandlithe-diagnosticssuites, the Go SDK tests, Node SDK tests and TypeScript type check. The target-without-project regression first reproduced the old forwarding behavior and now checks both rejection and a valid project–target pair.The command-level regression for missing and empty
testspassed with all 10lithe-buildtests on Windows x64 at3e713356.Permission and parameter checks, standalone report validation, contract/document links, the event catalog, Go SDK unit tests and Node host tests passed locally. All four SDK CI jobs and the Linux four-SDK end-to-end job passed at
205709bd. Local Clippy passed forlithe-buildandlithe-plugin-rpc, including test targets. The Windows SDK end-to-end run stopped while starting the Java and Node native-build fixtures (lsp.waitEvents,sessionFailed); Windows E2E remains unverified. The desktop consumer and UI evidence are in the companion PR.